#ifndef _BITTABLEMANAGER_H_
#define _BITTABLEMANAGER_H_

#include <map>
#include "diskbittable.h"
#include "membittable.h"
#include "hashablestring.h"
#include "bithashtablehandle.h"

class BitTableManager {
    public:
        typedef std::map<std::string, BitTable*> BitTableMap;

        ~BitTableManager();
        static BitTableManager *instance();

        BitHashTableHandle* createDiskTableHandle(std::string path, std::string name);
        BitHashTableHandle* createMemTableHandle(std::string name);

        BitHashTableHandle* getTableHandle(std::string name);
        void destoryTableHandle(std::string name);

    private:
        BitTableManager();
        static BitTableManager* m_instance;
        BitTableMap m_tables;
};

#endif

